<div id="headCrop" style="display:none">
    <div class="tailoring-content-one">
        <label title="选择图片" for="chooseImg" class="layui-btn" style="font-weight: normal">
            <input type="file" accept="image/jpg,image/jpeg,image/png" name="file" id="chooseImg" class="hidden" onchange="selectImg(this)"><i class="fa fa-cloud-upload"></i>
            选择图片
        </label>
    </div>
    <div class="ibox-content">
        <div class="tailoring-content">
            <div class="tailoring-content-two">
                <div class="tailoring-box-parcel" style="text-align: center">
                    <img id="tailoringImg">
                    <span class="word" style="position:relative;top:50%;font-size:14px;color: #c2c2c2">仅支持JPG、JPEG、PNG格式的图片文件</span><br>
                    <!--<span class="size" style="position:relative;top:50%;font-size:16px">文件不能大于2MB</span>-->
                </div>
                <div class="preview-box-parcel">
                    <!--<p>图片预览：</p>-->
                    <div class="square previewImg"></div>
                    <div class="circular previewImg"></div>
                </div>
            </div>
        </div>
    </div>
    <div class="modal-footer">
        <span class="layui-btn cropper-reset-btn" style="float:left">复位</span>
        <span class="layui-btn zoomIn" style="float:left">放大</span>
        <span class="layui-btn zoomOut" style="float:left">缩小</span>
        <span class="layui-btn cropper-rotate-btn" style="float:left">旋转</span>
        <span class="layui-btn cropper-scaleX-btn" style="float:left">换向</span>
        <span class="layui-btn " id="sureCut"><i class="fa fa-save"></i> 保存</span>
        <span class="layui-btn layui-btn-primary" onclick="layer.closeAll()"><i class="fa fa-close"></i> 关闭</span>
    </div>
</div>
<script src="__JS__/jquery.min.js?v=2.1.4"></script>
<script src="__JS__/bootstrap.js?v=3.3.7"></script>
<script src="__JS__/jquery.form.js"></script>
<script src="__JS__/plugins/layui/layui.js"></script>
<script src="__JS__/wk.js"></script>
<script src="__JS__/cropper.min.js"></script>
<script src="__JS__/plugins/viewer/viewer.js"></script>
<script src="__JS__/common.js"></script>
<script src="__JS__/plugins/webuploader/webuploader.js"></script><!--webUploader上传组件-->
<script src="__JS__/plugins/zTree/jquery.ztree.core-3.5.js"></script>
<script src="__JS__/plugins/zTree/jquery.ztree.excheck-3.5.js"></script>
<!--<script src="__JS__/plugins/zTree/jquery.ztree.exedit-3.5.js"></script>-->
<script src="__JS__/plugins/formSelects-v4/formSelects-v4.js"></script>
<script src="__JS__/plugins/wangEditor-3.1.1/release/wangEditor.js" ></script>
<script src="__JS__/plugins/wx-audio/wx-audio.js" ></script>
<script src="__JS__/plugins/ueditor/ueditor.config.js" ></script><!--百度编辑器-->
<script src="__JS__/plugins/ueditor/ueditor.all.js" ></script><!--百度编辑器-->
<script>
    layui.config({
        base: '/src/' //静态资源所在路径
    }).extend({
        index: 'index', //主入口模块
        interact : 'interact'//三级联动
    }).use(['index','interact']),function(){};
</script>
<script>
    //关闭自动填充
    // $('input').attr('autocomplete',"off");

    //view初始化查看图片
    $(function(){
        $('.img-circle').viewer();
    })
</script>
<script>
    //layui公共操作
    layui.use(['form','table'], function() {
        var form = layui.form
            , layer = layui.layer
            , table = layui.table

        //重置搜索框
        $('#empty').on('click', function () {
            $('.search').val('');
            // $(".search").trigger("chosen:updated");
            $('select').each(function (i, j) {
                $(j).find("option:selected").attr("selected", false);
                form.render('select')
            })
        });
        //表格排序
        table.on('sort(demo)', function(obj){
            table.reload('testReload', {
                initSort: obj //记录初始排序，如果不设的话，将无法标记表头的排序状态
                ,where: { //请求参数
                    field: obj.field //排序字段
                    ,order: obj.type //排序方式
                }
            });
        });
        //监听搜索
        form.on('submit(LAY-search)', function (data) {
            //执行重载
            table.reload('testReload', {
                page: {
                    curr: 1 //重新从第 1 页开始
                }
                ,where: data.field
            });
        });
    });
    //获取serialize数据转对象
    // $.fn.parseForm=function(){
    //     var serializeObj={};
    //     var array=this.serializeArray();
    //     var str=this.serialize();
    //     $(array).each(function(){
    //         if(serializeObj[this.name]){
    //             if($.isArray(serializeObj[this.name])){
    //                 serializeObj[this.name].push(this.value);
    //             }else{
    //                 serializeObj[this.name]=[serializeObj[this.name],this.value];
    //             }
    //         }else{
    //             serializeObj[this.name]=this.value;
    //         }
    //     });
    //     return serializeObj;
    // }
</script>
